/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 86184
 * Date: 2023-02-19
 * Time: 20:03
 */
public class CompareString {
    public static void main(String[] args) {
        String s1 = new String("hello");
        String s2 = new String("Hello");

        System.out.println(s1 == s2);

        System.out.println(s1.equals(s2));
        System.out.println(s1.equalsIgnoreCase(s2));  //忽略大小写

        int ret=s1.compareTo(s2);
        s1.compareToIgnoreCase(s2);  //忽略大小写

        if(ret>0){
            System.out.println("s1>s2");
        }else if(ret==0){
            System.out.println("s1==s2");
        }else{
            System.out.println("s1<s2");
        }
    }
}
